/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Background;

import Core.Vector2;
import Thing.Thing;
import java.io.IOException;
import javax.microedition.lcdui.Image;
import javax.microedition.lcdui.game.Sprite;

/**
 *
 * @author THINH
 */
public class Wall extends Background{
   
    
    public Wall(){
        againstVec = Vector2.Zero();
        
    
    }
    //main func
    public void CollisionWith(Thing thing){
        
        Vector2 curVel = thing.getVelocity();
        if(thing.status.isLeft() ){
            thing.setPos(thing.getPos().x+1,thing.getPos().y);
            thing.setVelocity(new Vector2(0,thing.getVelocity().y));
        }
        if(thing.status.isRight()){
            thing.setPos(thing.getPos().x-1,thing.getPos().y);            
            thing.setVelocity(new Vector2(0,thing.getVelocity().y));
        }
        super.CollisionWith(thing);
    }
    
}
